/*
 * @Author: jiayu
 * @Date: 2022-08-04 14:45:06
 * @LastEditors: jiayu
 * @LastEditTime: 2022-09-19 13:41:29
 * @Description:
 */
import DepTree from '@/components/DetTree';
import { useOrganizationalStore } from '';
import { AppstoreOutlined, AreaChartOutlined, EditOutlined, MailOutlined, ReadOutlined, SettingOutlined } from '@ant-design/icons';
import { Button, Drawer, Menu, MenuProps } from 'antd';
import { useState } from 'react';
import styles from './index.less';
const Organization = () => {
  const [showDeps, setShowDeps] = useState(false)
  const { currentPosi } = useModel('organizational')

  return (
    <div className={styles.organization}>
      <div className={styles.changeGroup}>
        <div className={styles.currentGroup}>当前统计区域：{currentPosi.map(item => item.short_name || item.title).join(' /')}</div>
        <Button size='small' type="primary" icon={<EditOutlined />} onClick={() => setShowDeps(true)}>
          {/* 切换组织/机构 */}
        </Button>
      </div>
      <Drawer
        width={600}
        visible={showDeps}
        onClose={() => {
          setShowDeps(false);
        }}
        closable={true}
        title="切换组织/机构"
      >
        <DepTree hide={() => setShowDeps(false)} />
      </Drawer>
    </div>
  );
};

export default Organization;
